<?php
Header("Content-type: text/css");
include("../../../pref.php");

mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db($db_name);

	function ext($filename) { 
		 $filename = strtolower($filename) ; 
		 $exts = split("[/\\.]", $filename) ; 
		 $n = count($exts)-1; 
		 $exts = $exts[$n]; 
		 return $exts; 
	 } 

	$design = mysql_fetch_array(mysql_query("SELECT * FROM ".DBPREFIX."css_definitions"));
	foreach($design as $key=>$value){
		if(ext(strtolower($design[$key])) == "jpg" || ext($design[$key]) == "gif" || ext($design[$key]) == "png" || ext($design[$key]) == "bmp"){ $design[$key] = "url(../../../../Uploads/".$value.")"; }
	}
?>

header, section, footer,
aside, nav, article, figure {
	display: block;
}

body { margin: 15px; padding: 0; font: 11px Verdana, Arial, Helvetica, sans-serif; background: <?php echo $design['body_bgimage']; ?> <?php echo $design['body_bgimage_repeat']; ?>; background-color: <?php echo $design['design_body_background']; ?>;}
h1 {font-size: <?php echo $design['h1_size'] ?>; color: <?php echo $design['h1_color'] ?>; font-weight: <?php echo $design['h1_weight']; ?>;}
h2 {font-size: <?php echo $design['h2_size'] ?>; color: <?php echo $design['h2_color'] ?>; font-weight: <?php echo $design['h2_weight']; ?>;}
h3 {font-size: <?php echo $design['h3_size'] ?>; color: <?php echo $design['h3_color'] ?>; font-weight: <?php echo $design['h3_weight']; ?>;}

a img{border: 0px;}
h1 a{color: <?php echo $design['h1_color'] ?>;}
a{color: #3B5998; text-decoration: none;}

.tbl1{background-color: #ffffff;	}
.tbl2{background-color: #ffffff;	}
hr{border: 0; border-style: inset; height: 1px; background-color: #c2c2c2;}

/* layout */
header#header {padding: 10px; margin: 0; height:<?php echo $design['header_height']; ?>px;}

aside#sidebar-left {float: left; width: 190px; padding: 10px; }
aside#sidebar-right {float: left; width: 190px; padding: 10px; }

nav#topnav{border-bottom: 10px solid <?php echo $design['design_header_background']; ?>; padding: 0 5px;}
nav#topnav ul{padding: 0.5em 0; margin: 0;}
nav#topnav li{margin-right: 0.2em; display: inline; list-style: none; }
nav#topnav li a{text-decoration: none; padding: 0.5em 1em; margin: 5px; margin-left: 0; background: #2C2C2C; color: #ffffff;	font-weight: bold; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-left-radius: 5px 5px; border-bottom-right-radius: 5px 5px; }
nav#topnav a:link{color: #ffffff;}
nav#topnav a:visited{color: #ffffff;}
nav#topnav a:hover{background: #D66F06; border-bottom: 0px solid #ffffff; color: #ffffff;}
nav#topnav a#current{background: #D66F06; border-bottom: 0px solid #ffffff; color: #ffffff;}

nav#toolbar{background: url(../../../images/admin/background_top_toolbar.gif) #000;margin-right: 0.2em; display: inline; list-style: none;  padding: 0 5px;
	height: 40px;
	width: 100%;
	font-size: 11px;
	font-family: verdana;
	position: fixed;
	}
nav#toolbar li img{
	width: 18px;
	height: 18px;
	margin: -5px 5px;
}

nav#toolbar {border-bottom: 1px solid #585858;}
nav#toolbar ul{padding: 15px 0px; margin: 0;}
nav#toolbar li{margin-left: 0.2em;  display: inline; list-style: none; cursor: pointer;}
nav#toolbar li label{text-decoration: none;  cursor: pointer; margin: 10px; margin-left: 0; color: #999999;	font-weight: bold;}
nav#toolbar a:link{color: #ffffff;}
nav#toolbar a:visited{color: #ffffff;}
nav#toolbar a:hover{ border-bottom: 0px solid #ffffff; color: #ffffff;}
nav#toolbar a#current{; border-bottom: 0px solid #ffffff; color: #ffffff;}

nav#toolbar li.spacer{
background-image: url('../../../../images/navi_top_spacer.gif');
background-repeat: no-repeat;
height: 24px;
padding: 4px 10px 0px 10px;
}

nav#subnav{padding: 0 5px;}
nav#subnav ul{padding: 0 0; margin: 0;}
nav#subnav li{list-style: none; padding: 3px;}

nav.toolbar_window_nav a img{
	width: 18px;
	height: 18px;
	margin: -5px 5px;
}


nav.toolbar_window_nav ul{padding: 0 0; margin: 0;}
nav.toolbar_window_nav ul::first-child{border-top:0px;}
nav.toolbar_window_nav li:hover{background: #2A2A2A;}
nav.toolbar_window_nav li{list-style: none;
	color: #999999;
	height: 24px;
	border: 1px solid #2A2A2A;
	border-top: 1px solid #585858;
	background-color: #3A3A3A;
	padding: 10px 0px 0px 10px;
}
li.toolbar_window_title{

}

.selected{background: #2A2A2A;}

footer#footer {clear: both; padding: 10px; height:<?php echo $design['footer_height']; ?>px; <?php echo $design['footer_bgimage']; ?> <?php echo $design['footer_bgimage_repeat']; ?> ; background-color: <?php echo $design['design_footer_background']; ?>; color: #ffffff;}
footer#footer a{color: #ffffff;}

table#admin_menu td{
	width: 120px;
}


#widget-left-list {
		display: inline;
	list-style: none;
	width: 350px;
}

#widget-left-list li {
	display: block;
	padding: 20px 10px; margin-bottom: 3px;
	background-color: #efefef;
}

#widget-left-list li img.handle {
	margin-right: 20px;
	cursor: move;
}

#widget-right-list {
	display: inline;
	list-style: none;
	width: 320px;
}

#widget-right-list li {
	display: block;
	padding: 20px 10px; margin-bottom: 3px;
	background-color: #efefef;
}

.handle {
	background: url(../../../../../images/list_move.png) no-repeat;
	height: 19px;
	padding-right: 20px;
	padding-bottom: 5px;
	cursor: move;
}

input{
	border: 1px solid #ccc;	
}

input[type=submit]:hover,input[type=button]:hover{
	cursor: pointer;
}

input[type=submit]:focus,input[type=button]:focus{
	border: 1px solid #000;	
}